﻿@using eLoan.Models;
@model LoanTypeModel

@{
    ViewBag.Title = "Add/Edit Loan Type";
}

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>Add/Edit Loan Type</h2>
        <ol class="breadcrumb">
            <li>
                Administration
            </li>
            <li>
                <a href="@Url.Action("LoanTypes", "Administration")">Loan Types</a>
            </li>
            <li class="active">
                <strong>Add/Edit Loan Type</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2"></div>
</div>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-8">
            <div class="ibox float-e-margins">
                @using (Html.BeginForm("Save", "LoanType", FormMethod.Post, new { id = "saveForm" }))
                {
                    @Html.AntiForgeryToken()
                    @Html.ValidationSummary(true)
                    
                    <div class="ibox-title">
                        <div>@Html.ValidationMessageFor(m => m.LoanType.LoanTypeName)</div>
                        <div>@Html.ValidationMessageFor(m => m.LoanType.Description)</div>
                    </div>
                    <div class="ibox-content">
                        <fieldset>

                            <table class="table table-bordered table-striped">
                                <tr>
                                    <th>
                                        @if (Model.DBCommand == "Edit")
                                        { @Html.HiddenFor(m => m.LoanType.ID) }
                                        @Html.LabelFor(m => m.LoanType.LoanTypeName)
                                    </th>
                                    <td>@Html.TextBoxFor(m => m.LoanType.LoanTypeName, new { @class = "single-line scroll-field1" })</td>
                                </tr>
                                <tr>
                                    <th>@Html.LabelFor(m => m.LoanType.Description)</th>
                                    <td>@Html.TextBoxFor(m => m.LoanType.Description, new { @class = "single-line scroll-field1" })</td>
                                </tr>
                                <tr>
                                    <th>@Html.LabelFor(m => m.LoanType.IsActive)</th>
                                    <td>@Html.CheckBoxFor(m => m.LoanType.IsActive, new { @checked = "checked" })</td>
                                </tr>
                            </table>

                            <p></p>

                            <button type="submit" id="btnSave" class="btn btn-primary" name="command" value=@Model.DBCommand>Save</button>
                            <button type="submit" id="btnCancel" class="btn btn-primary cancel" name="command" value="Cancel">Cancel</button>

                        </fieldset>
                    </div>
                }
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}


